//
//  ConsumptionStateView.m
//  BaseFrame
//
//  Created by 吕金状 on 2017/6/28.
//  Copyright © 2017年 com.mxh. All rights reserved.
//

#import "ConsumptionStateView.h"

@interface ConsumptionStateView  ()



@end

@implementation ConsumptionStateView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.typeButton];
    }
    return self;
}

- (UIButton *)typeButton{
    if (!_typeButton) {
        _typeButton = [[UIButton alloc]initWithFrame:CGRectMake((SCREEN_WIDTH - 100 / WIDTH_5S_SCALE) / 2, 10 / WIDTH_5S_SCALE,100 / WIDTH_5S_SCALE, 20 / WIDTH_5S_SCALE)];
        _typeButton.titleLabel.font = DEF_FontSize_14;
        [_typeButton setTitle:@"进店未消费" forState:UIControlStateNormal];
        [_typeButton setTitle:@"进店已消费" forState:UIControlStateSelected];
        _typeButton.layer.masksToBounds = YES;
        _typeButton.layer.cornerRadius = 5;
        _typeButton.backgroundColor = getColor(@"07bb5d");
        [_typeButton setTitleColor:getColor(@"ffffff") forState:UIControlStateNormal];
        [_typeButton addTarget:self action:@selector(typeButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _typeButton;
}

- (void)typeButtonClick:(UIButton *)sender{
    if (sender.selected) {
        return;
    }
    if (_getStateClick) {
        _getStateClick();
    }
}

@end
